package com.buer.storage.common.eumn;

/**
 *
 * @ProjectName:
 * @Package:        com.buer.storage.common.eumn
 * @ClassName:      ResultEnum
 * @Description:    枚举方式统一管理错误编码
 * @Author:         lds
 * @CreateDate:     2021/1/14 17:23
 * @UpdateUser:     更新者
 * @UpdateDate:     2021/1/14 17:23
 * @UpdateRemark:   更新内容
 * @Version:        1.0
 */
public enum ResultEnum {

    FAILURE(0, "失败"),
    SUCCESS(1, "成功"),
    NAME_NULL(101, "用户名称不能为空"),
    USERNAME_NULL(102, "账号不能为空"),
    PASSWORD_NULL(103, "密码不能为空"),
    EXIT_USERNAME(104, "该账号已存在"),
    NO_EXIT_USER(105, "该用户不存在，请重新登陆"),
    ERROR_PASSWORD(106, "密码错误"),
    ERROR_OLD_PASSWORD(107, "原密码错误"),


    USER_FORBIDDEN(201, "该用户被禁用"),
    PARAME_ERROR(400, "参数错误"),
    SERVER_ERROR(500, "服务繁忙"),
    REDIS_SERVER_ERROR(501, "redis服务繁忙"),
    TOKEN_INVALID_ERROR(505, "身份过期，请重新登录"),
    ILLEGAL_ERROR(-100,"非法请求"),
    ;
    private Integer code;

    private String msg;

    ResultEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
